<template>
	<view class="m30">
		<view class="flex">
			<u-icon v-if="info.status == 0 " name="clock-fill" color="#4AC77D" size="20"></u-icon>
			<u-icon v-if="info.status == 1" name="checkmark-circle-fill" color="#7E8DFF" size="20"></u-icon>
			<text class="ml10 c343">{{status[info.status]}}</text>
		</view>
		<u-gap height="20"></u-gap>
		<view class="bgFff radius30 p30">
			<view class="flex flex-start list-item pore mb30" v-if="info.opinion">
				<view class="circle pore"></view>
				<view class="ml20 flex1">
					<view class="c343 bold">处理完成</view>
					<view class="f24 c999 mt10">{{info.updateTime}}</view>
					<view class="mt20 p20 radius30 c343 bgF7">
						{{info.opinion}}
					</view>
				</view>
			</view>
			<view class="flex flex-start list-item pore">
				<view class="circle pore"></view>
				<view class="ml20 flex1">
					<view class="c343 bold">发起举报</view>
					<view class="f24 c999 mt10">{{info.createTime}}</view>
					<view class="mt20 p20 radius30 c343 bgF7">
						<view>
							投诉类型：{{info.type}} <br>
							<u-gap height="5"></u-gap>
							被投诉用户昵称：{{info.complaintUserNickName}}<br>
							<u-gap height="5"></u-gap>
							投诉时间：{{info.createTime}}<br>
							<u-gap height="5"></u-gap>
							投诉描述：{{info.content}}<br>
						</view>
						<view v-if="info.img">
							<view>
								投诉凭证：
							</view>
							<view class="flex-wrap mt20">
								<view class="image-box" v-for="(item,index) in info.img.split(',')" :key="index"
									@click="$utils.previewImages(index,info.img.split(','))">
									<image class="image_5" referrerpolicy="no-referrer" :src="api_host + item" />
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		complaintDetail
	} from '@/common/api_meethuangshi.js'
	export default {
		name: '',
		data() {
			return {
				id: '',
				info: null,
				status:{
					0:'处理中',
					1:'处理完成'
				}
			}
		},
		onLoad(option) {
			this.id = option.id;
			this.getComplaintDetail()
		},
		methods: {
			async getComplaintDetail() {
				uni.showLoading({
					mask: true
				})
				const res = await complaintDetail({
					id: this.id
				})
				if (res.code == 200) {
					uni.hideLoading()
					this.info = res.data;
				}
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F7F6FF;
	}

	.list-item {}

	.list-item::before {
		content: '';
		position: absolute;
		width: 1px;
		height: 100%;
		top: 12rpx;
		left: 10rpx;
		background-color: #ddd;
		z-index: 0;
	}

	.circle {
		width: 20rpx;
		height: 20rpx;
		border-radius: 50%;
		background-color: #319EFF;
		margin-top: 10rpx;
	}

	.image-box {
		display: inline-block;
		width: 160rpx;
		height: 160rpx;
		margin-right: 10rpx;
		margin-bottom: 10rpx;

		.image_5 {
			width: 160rpx;
			height: 160rpx;
		}
	}
</style>